<!DOCTYPE html>
<html >
<head>
    <meta charset="UTF-8">
    <title>物资需求计划</title>
    <script type="text/javascript">
        $(function () {
        $.get("/scgl_scjhSelectThisDo",null,function (data) {
            var html="<select id='scgl_myselect_id'  name='scgl_myselect_id' onchange=\"show_sub()\" style=\"width: 100%;height: 100%\">\n" +
                "                            <option  name='scgl_wzxqjh_mpp_id' value=\"\">请选择一个生产计划</option>";
           for(i=0;i<data.scglScjhs.length;i++){
               html+= "<option value=\""+data.scglScjhs[i].scglScjhDocumentnum+"\">"+data.scglScjhs[i].scglScjhDocumentnum+"</option>";
           }
            html+= "                        </select>";
            $("#scgl_wzxqjh_mpp_id_fathertd").append(html);
        });

        });
        function show_sub(){
            $.get("/scgl_scjhselectOne?scglScjhDocumentnum="+$("#scgl_myselect_id").find("option:selected").val(),null,
                function (data) {

               $("#scgl_wzxqjh_allProductionNum").val(""+data.scglScjhAllproductionnum+"");
            });

        }
        layui.use('laydate', function(){
            var laydate = layui.laydate;
            laydate.render({
                elem: '#scgl_wzxqjh_documentDate' //指定元素
            });

        });
        //非空验证
        function verify() {
            var scgl_wzxqjh_documentNum = $("#scgl_wzxqjh_documentNum").val();
            var scgl_wzxqjh_subject = $("#scgl_wzxqjh_subject").val();
            var scgl_wzxqjh_personInCharge = $("#scgl_wzxqjh_personInCharge").val();
            var scgl_wzxqjh_department = $("#scgl_wzxqjh_department").val();
            var scgl_wzxqjh_mpp_id = $("#scgl_myselect_id").find("option:selected").val();
            var scgl_wzxqjh_allProductionNum = $("#scgl_wzxqjh_allProductionNum").val();
            var scgl_wzxqjh_singlePlayer = $("#scgl_wzxqjh_singlePlayer").val();
            var scgl_wzxqjh_documentDate = $("#scgl_wzxqjh_documentDate").val();


            if (scgl_wzxqjh_documentNum ==null||scgl_wzxqjh_documentNum=="") {
                alert('单据编号不能为空');
                return false;
            }
            if (scgl_wzxqjh_subject == null||scgl_wzxqjh_subject=="") {
                alert('主题不能为空');
                return false;
            }
            if (scgl_wzxqjh_personInCharge == null ||scgl_wzxqjh_personInCharge=="") {
                alert('负责人不能为空');
                return false;
            }
            if (scgl_wzxqjh_department == null||scgl_wzxqjh_department=="" ) {
                alert('部门不能为空');
                return false;
            }
            if (scgl_wzxqjh_mpp_id ==null||scgl_wzxqjh_mpp_id=="") {
                alert('生产计划不能为空');
                return false;
            }
            if (scgl_wzxqjh_allProductionNum ==null||scgl_wzxqjh_allProductionNum=="") {
                alert('生产计划数量总量不能为空');
                return false;
            }
            if (scgl_wzxqjh_singlePlayer == null ||scgl_wzxqjh_singlePlayer=="") {
                alert('制单人不能为空');
                return false;
            }
            if (scgl_wzxqjh_documentDate ==null||scgl_wzxqjh_documentDate=="" ) {
                alert('制单日期不能为空');
                return false;
            }
        }
    </script>
    <style>
        .scgl_scgl_firstul {
            margin-top: 10px;
        }

        .scgl_scgl_firstul li {
            list-style: none;
            float: left;
            margin-left: 10px;
        }
        .scgl_scgl_firstdiv {

            height: 55px;
            width: 100%;
            border: 2px solid slategray;
        }
        .scgl_scgl_secontdiv {
            margin-top: 10px;
            width: 100%;
            height: 150px;
        }
        .scgl_scgl_firsttable {
            width: 100%;
            height: 100%;
            border:slategray 2px solid ;

        }
        .scgl_scgl_firsttable tr {
            border-bottom: 2px solid slategray;

        }
        .scgl_scgl_firsttable_tr_td {
            background-color: #FFFFF0;
            border-right: 2px solid slategray;
            width: 14%;
            height: 25%;

        }
        .scgl_scgl_firsttable_tr_td01 {
            border-right: 2px solid slategray;
            width: 14%;
            height: 25%;

        }
        .scgl_scgl_firsttable_tr_td01 input{
            border: none;
            width: 100%;
            height: 100%;
        }
        .scgl_scgl_thirdiv {
            margin-top: 10px;
            width: 100%;
            height: 300px;
        }
        .scgl_scgl_secondtable {

            width: 100%;
            height: 100%;
            border:slategray 2px solid ;
        }

        .scgl_scgl_secondtable tr{
            border-bottom: 2px solid slategray;
        }

        .scgl_scgl_secondtable_tr_td {
            background-color: #FFFFF0;
            border-right: 2px solid slategray;
            width: 14%;
            height: 14%;
        }
        .scgl_scgl_secondtable_tr_td01 input {
            border: none;
            width: 100%;
            height: 100%;
        }
        .scgl_scgl_secondtable_tr_td01 {
            border-right: 2px solid slategray;
            width: 14%;
            height: 14%;
        }
        .scgl_scgl_thirdtable tr{
            border-bottom: 2px solid slategray;
        }
    </style>
</head>
<body>

<div style="background-color: white">
    <!--页面主题-->
    <div style="height: 50px;width: 100%; font-weight: bold;text-align: center;font-size: 30px">新建物料需求计划</div>
    <!--form表单-->
    <form action="/scgl_wzxqjhInsert" onsubmit="return verify()">
        <!--操作按钮-->
        <div class="scgl_scgl_firstdiv">
            <ul class="scgl_scgl_firstul">
                <li><input class="layui-btn layui-btn-radius" type="submit" value="保存"></li>
            </ul>
        </div>
        <!--需要填写的详细信息-->
        <div class="scgl_scgl_secontdiv">
            <table class="scgl_scgl_firsttable" cellpadding="0px" cellspacing="0px" border="2px" >
                <!--               第一行-->
                <tr>
                    <td colspan="6">基本信息</td>
                </tr>
                <!--                第二行-->
                <tr>
                    <td class="scgl_scgl_firsttable_tr_td">单据编号</td>
                    <td class="scgl_scgl_firsttable_tr_td01">
                        <input  type="text" id="scgl_wzxqjh_documentNum" name="scgl_wzxqjh_documentNum"/>
                    </td>
                    <td class="scgl_scgl_firsttable_tr_td">主题</td>
                    <td class="scgl_scgl_firsttable_tr_td01">
                        <input  type="text" id="scgl_wzxqjh_subject" name="scgl_wzxqjh_subject"/>
                    </td>
                    <td class="scgl_scgl_firsttable_tr_td">负责人</td>
                    <td class="scgl_scgl_firsttable_tr_td01">
                        <input  type="text" id="scgl_wzxqjh_personInCharge" name="scgl_wzxqjh_personInCharge"/>
                    </td>
                </tr>
                <!--               第三行-->
                <tr >
                    <td class="scgl_scgl_firsttable_tr_td">部门</td>
                    <td  class="scgl_scgl_firsttable_tr_td01">
                        <input  type="text"  id="scgl_wzxqjh_department" name="scgl_wzxqjh_department"/>
                    </td>
                    <td class="scgl_scgl_firsttable_tr_td">主生产计划</td>
                    <td  id="scgl_wzxqjh_mpp_id_fathertd" class="scgl_scgl_firsttable_tr_td01">
                    </td>
                    <td class="scgl_scgl_firsttable_tr_td"></td>
                    <td class="scgl_scgl_firsttable_tr_td01">
                        <input  type="text"  />
                    </td>
                </tr>
            </table>
        </div>
        <!-- /基本信息下需要填写的信息-->
        <!--     合计信息   -->
        <div class="scgl_scgl_thirdiv">
            <table class="scgl_scgl_secondtable" cellpadding="0px" cellspacing="0px" border="2px" >
                <!--               第一行-->
                <tr>
                    <td colspan="6">合计信息</td>
                </tr>
                <!--                第二行-->
                <tr>
                    <td class="scgl_scgl_secondtable_tr_td">生产计划数量合计</td>
                    <td class="scgl_scgl_secondtable_tr_td01" colspan="5">
                        <input  type="text" id="scgl_wzxqjh_allProductionNum"  name="scgl_wzxqjh_allProductionNum"/>
                    </td>

                </tr>
                <!--     第三行-->
                <tr>
                    <td colspan="6">备注信息</td>
                </tr>

                <!--               第四行-->
                <tr>
                    <td class="scgl_scgl_secondtable_tr_td">单据状态</td>
                    <td class="scgl_scgl_secondtable_tr_td01">
                        <input  type="text" id="scgl_wzxqjh_billsStatus"  name="scgl_wzxqjh_billsStatus"/>
                    </td>
                    <td class="scgl_scgl_secondtable_tr_td">制单人</td>
                    <td class="scgl_scgl_secondtable_tr_td01">
                        <input  type="text" id="scgl_wzxqjh_singlePlayer" name="scgl_wzxqjh_singlePlayer"/>
                    </td>
                    <td class="scgl_scgl_secondtable_tr_td">制单日期</td>
                    <td class="scgl_scgl_secondtable_tr_td01">
                        <input type="text" name="scgl_wzxqjh_documentDate" class="layui-input" id="scgl_wzxqjh_documentDate">
                    </td>
                </tr>
                <!--              第五行-->
                <tr>
                    <td class="scgl_scgl_secondtable_tr_td">确认人</td>
                    <td class="scgl_scgl_secondtable_tr_td01">
                        <input  type="text" id="scgl_wzxqjh_confirmPeople"  name="scgl_wzxqjh_confirmPeople"/>
                    </td>
                    <td class="scgl_scgl_secondtable_tr_td">确认日期</td>
                    <td class="scgl_scgl_secondtable_tr_td01">
                        <input type="text" name="scgl_wzxqjh_confirmDate" class="layui-input " id="scgl_wzxqjh_confirmDate">
                    </td>
                    <td class="scgl_scgl_secondtable_tr_td">结单人</td>
                    <td class="scgl_scgl_secondtable_tr_td01">
                        <input  type="text" id="scgl_wzxqjh_statementPeople" name="scgl_wzxqjh_statementPeople"/>
                    </td>
                </tr>
                <!--              第六行-->
                <tr>
                    <td class="scgl_scgl_secondtable_tr_td">结单日期</td>
                    <td class="scgl_scgl_secondtable_tr_td01">
                        <input  type="text" id="scgl_wzxqjh_dateofOrder" name="scgl_wzxqjh_dateofOrder"/>
                    </td>
                    <td class="scgl_scgl_secondtable_tr_td">最后更新人</td>
                    <td class="scgl_scgl_secondtable_tr_td01">
                        <input  type="text" id="scgl_wzxqjh_lastUpdatePeople" name="scgl_wzxqjh_lastUpdatePeople"/>
                    </td>
                    <td class="scgl_scgl_secondtable_tr_td">最后更新日期</td>
                    <td class="scgl_scgl_secondtable_tr_td01">
                        <input  type="text" id="scgl_wzxqjh_lastUpdateDate" name="scgl_wzxqjh_lastUpdateDate"/>
                    </td>
                </tr>
                <!--     第七行-->
                <tr>
                    <td class="scgl_scgl_secondtable_tr_td">备注</td>
                    <td class="scgl_scgl_secondtable_tr_td01" colspan="5">
                        <input  type="text" id="scgl_wzxqjh_remarks"  name="scgl_wzxqjh_remarks"/>
                    </td>
                </tr>
            </table>
        </div>

</div>



</body>
</html>